public class Solution {

    public int sumNums(int n) {
        boolean flag = n == 1 || (n += sumNums(n-1)) > 0;  // 短路可以实现递归出口
        return n;
    }

    public int sumNums2(int n) {
        boolean flag = n > 1 && (n += sumNums(n-1)) < 0;
        return n;
    }
}
